﻿<template>
  <div>
    <a-card :bordered="false" :bodyStyle="tstyle">

      <div class="table-page-search-wrapper" v-if="hasPerm('OutpPrescriptDetail:page')">
        <a-form layout="inline">
          <a-row :gutter="48">
            <a-col :md="8" :sm="24">
              <a-form-item label="">
                <a-input v-model="queryParam.autoNo" allow-clear placeholder="请输入"/>
              </a-form-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-item label="">
                <a-input v-model="queryParam.selfNo" allow-clear placeholder="请输入"/>
              </a-form-item>
            </a-col><template v-if="advanced">
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.outpNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.patientName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.deptCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.doctorCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.doctorName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.performedByCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.performedByName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.prescriptDoctorCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.prescriptDoctorName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.inputDateDate" @change="onChangeinputDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.checkerName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.performeder" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.checkerDateDate" @change="onChangecheckerDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.operCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.operDateDate" @change="onChangeoperDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.presStatus" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.presFeeType" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.presStyle" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.prescriptStyle" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.sysClass" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemId" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemUnit" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemSpec" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemPrice" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.amount" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.repetition" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.frequency" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.dose" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.doseUnit" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.dosage" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.presDescrib" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.drugForm" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.usage" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.expense" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.remark" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.presPrnFlag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.costs" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.patternCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.priority" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.presCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.prescriptCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.deptName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siLevel" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.classOnRcpt" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.classOnReckoning" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.subjCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.period" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.relationPres" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.periodTimes" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.visitNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.fatherFlag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.seqNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.bespokeTimeDate" @change="onChangebespokeTime"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.bespokeTimeEndDate" @change="onChangebespokeTimeEnd"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.toxiNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.checkDeptFlag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.syGroup" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.hospCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.bespokeOperDateDate" @change="onChangebespokeOperDate"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.bespokeModifyDateDate" @change="onChangebespokeModifyDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.hmPresId" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.appointmentBatchCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="创建时间">
                  <a-date-picker style="width: 100%" placeholder="请选择创建时间" v-model="queryParam.creatceDateDate" @change="onChangecreatceDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="创建者Id">
                  <a-input v-model="queryParam.createUserId" allow-clear placeholder="请输入创建者Id"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="创建者名称">
                  <a-input v-model="queryParam.createUserName" allow-clear placeholder="请输入创建者名称"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="更新时间">
                  <a-date-picker style="width: 100%" placeholder="请选择更新时间" v-model="queryParam.modifyDateDate" @change="onChangemodifyDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="修改者Id">
                  <a-input v-model="queryParam.modifyUserId" allow-clear placeholder="请输入修改者Id"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="修改者名称">
                  <a-input v-model="queryParam.modifyUserName" allow-clear placeholder="请输入修改者名称"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="删除时间">
                  <a-date-picker style="width: 100%" placeholder="请选择删除时间" v-model="queryParam.deleteDateDate" @change="onChangedeleteDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="删除者ID">
                  <a-input v-model="queryParam.deleteUserId" allow-clear placeholder="请输入删除者ID"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="删除者姓名">
                  <a-input v-model="queryParam.deleteUserName" allow-clear placeholder="请输入删除者姓名"/>
                </a-form-item>
              </a-col>            </template>

            <a-col :md="8" :sm="24" >
              <span class="table-page-search-submitButtons">
                <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button>
                <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
                <a @click="toggleAdvanced" style="margin-left: 8px"> {{ advanced ? '收起' : '展开' }}
                  <a-icon :type="advanced ? 'up' : 'down'"/>
                </a>
              </span>
            </a-col>

          </a-row>
        </a-form>
      </div>
    </a-card>
    <a-card :bordered="false">
      <s-table
        ref="table"
        :columns="columns"
        :data="loadData"
        :alert="true"
        :rowKey="(record) => record.iD"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
        <template class="table-operator" slot="operator" v-if="hasPerm('OutpPrescriptDetail:add')" >
          <a-button type="primary" v-if="hasPerm('OutpPrescriptDetail:add')" icon="plus" @click="$refs.addForm.add()">新增医嘱</a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a v-if="hasPerm('OutpPrescriptDetail:edit')" @click="$refs.editForm.edit(record)">编辑</a>
          <a-divider type="vertical" v-if="hasPerm('OutpPrescriptDetail:edit') & hasPerm('OutpPrescriptDetail:delete')"/>
          <a-popconfirm v-if="hasPerm('OutpPrescriptDetail:delete')" placement="topRight" title="确认删除？" @confirm="() => OutpPrescriptDetailDelete(record)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </s-table>
      <add-form ref="addForm" @ok="handleOk" />
      <edit-form ref="editForm" @ok="handleOk" />
    </a-card>
  </div>
</template>
<script>
  import { STable } from '@/components'
  import moment from 'moment'
  import { OutpPrescriptDetailPage, OutpPrescriptDetailDelete } from '@/api/modular/main/OutpPrescriptDetailManage'
  import addForm from './addForm.vue'
  import editForm from './editForm.vue'
  export default {
    components: {
      STable,
      addForm,
      editForm
    },
    data () {
      return {
        advanced: false, // 高级搜索 展开/关闭
        queryParam: {},
        columns: [
          {
            title: '',
            align: 'center',
            dataIndex: 'autoNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'selfNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'outpNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'patientName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'deptCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'doctorCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'doctorName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'performedByCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'performedByName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'prescriptDoctorCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'prescriptDoctorName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'inputDate'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'checkerName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'performeder'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'checkerDate'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'operCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'operDate'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'presStatus'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'presFeeType'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'presStyle'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'prescriptStyle'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'sysClass'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemId'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemUnit'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemSpec'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemPrice'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'amount'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'repetition'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'frequency'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'dose'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'doseUnit'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'dosage'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'presDescrib'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'drugForm'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'usage'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'expense'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'remark'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'presPrnFlag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'costs'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'patternCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'priority'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'presCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'prescriptCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'deptName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siLevel'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'classOnRcpt'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'classOnReckoning'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'subjCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'period'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'relationPres'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'periodTimes'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'visitNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'fatherFlag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'seqNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'bespokeTime'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'bespokeTimeEnd'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'toxiNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'checkDeptFlag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'syGroup'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'hospCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'bespokeOperDate'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'bespokeModifyDate'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'hmPresId'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'appointmentBatchCode'
          },
          {
            title: '创建时间',
            align: 'center',
            dataIndex: 'creatceDate'
          },
          {
            title: '创建者Id',
            align: 'center',
            dataIndex: 'createUserId'
          },
          {
            title: '创建者名称',
            align: 'center',
            dataIndex: 'createUserName'
          },
          {
            title: '更新时间',
            align: 'center',
            dataIndex: 'modifyDate'
          },
          {
            title: '修改者Id',
            align: 'center',
            dataIndex: 'modifyUserId'
          },
          {
            title: '修改者名称',
            align: 'center',
            dataIndex: 'modifyUserName'
          },
          {
            title: '删除时间',
            align: 'center',
            dataIndex: 'deleteDate'
          },
          {
            title: '删除者ID',
            align: 'center',
            dataIndex: 'deleteUserId'
          },
          {
            title: '删除者姓名',
            align: 'center',
            dataIndex: 'deleteUserName'
          }
        ],
        tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
        // 加载数据方法 必须为 Promise 对象
        loadData: parameter => {
          return OutpPrescriptDetailPage(Object.assign(parameter, this.switchingDate())).then((res) => {
            return res.data
          })
        },
        selectedRowKeys: [],
        selectedRows: []
      }
    },
    created () {
      if (this.hasPerm('OutpPrescriptDetail:edit') || this.hasPerm('OutpPrescriptDetail:delete')) {
        this.columns.push({
          title: '操作',
          width: '150px',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' }
        })
      }
    },
    methods: {
      moment,
      /**
       * 查询参数组装
       */
      switchingDate () {
        const queryParaminputDate = this.queryParam.inputDateDate
        if (queryParaminputDate != null) {
            this.queryParam.inputDate = moment(queryParaminputDate).format('YYYY-MM-DD')
            if (queryParaminputDate.length < 1) {
                delete this.queryParam.inputDate
            }
        }
        const queryParamcheckerDate = this.queryParam.checkerDateDate
        if (queryParamcheckerDate != null) {
            this.queryParam.checkerDate = moment(queryParamcheckerDate).format('YYYY-MM-DD')
            if (queryParamcheckerDate.length < 1) {
                delete this.queryParam.checkerDate
            }
        }
        const queryParamoperDate = this.queryParam.operDateDate
        if (queryParamoperDate != null) {
            this.queryParam.operDate = moment(queryParamoperDate).format('YYYY-MM-DD')
            if (queryParamoperDate.length < 1) {
                delete this.queryParam.operDate
            }
        }
        const queryParambespokeTime = this.queryParam.bespokeTimeDate
        if (queryParambespokeTime != null) {
            this.queryParam.bespokeTime = moment(queryParambespokeTime).format('YYYY-MM-DD')
            if (queryParambespokeTime.length < 1) {
                delete this.queryParam.bespokeTime
            }
        }
        const queryParambespokeTimeEnd = this.queryParam.bespokeTimeEndDate
        if (queryParambespokeTimeEnd != null) {
            this.queryParam.bespokeTimeEnd = moment(queryParambespokeTimeEnd).format('YYYY-MM-DD')
            if (queryParambespokeTimeEnd.length < 1) {
                delete this.queryParam.bespokeTimeEnd
            }
        }
        const queryParambespokeOperDate = this.queryParam.bespokeOperDateDate
        if (queryParambespokeOperDate != null) {
            this.queryParam.bespokeOperDate = moment(queryParambespokeOperDate).format('YYYY-MM-DD')
            if (queryParambespokeOperDate.length < 1) {
                delete this.queryParam.bespokeOperDate
            }
        }
        const queryParambespokeModifyDate = this.queryParam.bespokeModifyDateDate
        if (queryParambespokeModifyDate != null) {
            this.queryParam.bespokeModifyDate = moment(queryParambespokeModifyDate).format('YYYY-MM-DD')
            if (queryParambespokeModifyDate.length < 1) {
                delete this.queryParam.bespokeModifyDate
            }
        }
        const queryParamcreatceDate = this.queryParam.creatceDateDate
        if (queryParamcreatceDate != null) {
            this.queryParam.creatceDate = moment(queryParamcreatceDate).format('YYYY-MM-DD')
            if (queryParamcreatceDate.length < 1) {
                delete this.queryParam.creatceDate
            }
        }
        const queryParammodifyDate = this.queryParam.modifyDateDate
        if (queryParammodifyDate != null) {
            this.queryParam.modifyDate = moment(queryParammodifyDate).format('YYYY-MM-DD')
            if (queryParammodifyDate.length < 1) {
                delete this.queryParam.modifyDate
            }
        }
        const queryParamdeleteDate = this.queryParam.deleteDateDate
        if (queryParamdeleteDate != null) {
            this.queryParam.deleteDate = moment(queryParamdeleteDate).format('YYYY-MM-DD')
            if (queryParamdeleteDate.length < 1) {
                delete this.queryParam.deleteDate
            }
        }
        const obj = JSON.parse(JSON.stringify(this.queryParam))
        return obj
      },
      OutpPrescriptDetailDelete (record) {
        OutpPrescriptDetailDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          } else {
            this.$message.error('删除失败') // + res.message
          }
        })
      },
      toggleAdvanced () {
        this.advanced = !this.advanced
      },
      onChangeinputDate(date, dateString) {
        this.inputDateDateString = dateString
      },
      onChangecheckerDate(date, dateString) {
        this.checkerDateDateString = dateString
      },
      onChangeoperDate(date, dateString) {
        this.operDateDateString = dateString
      },
      onChangebespokeTime(date, dateString) {
        this.bespokeTimeDateString = dateString
      },
      onChangebespokeTimeEnd(date, dateString) {
        this.bespokeTimeEndDateString = dateString
      },
      onChangebespokeOperDate(date, dateString) {
        this.bespokeOperDateDateString = dateString
      },
      onChangebespokeModifyDate(date, dateString) {
        this.bespokeModifyDateDateString = dateString
      },
      onChangecreatceDate(date, dateString) {
        this.creatceDateDateString = dateString
      },
      onChangemodifyDate(date, dateString) {
        this.modifyDateDateString = dateString
      },
      onChangedeleteDate(date, dateString) {
        this.deleteDateDateString = dateString
      },
      handleOk () {
        this.$refs.table.refresh()
      },
      onSelectChange (selectedRowKeys, selectedRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectedRows = selectedRows
      }
    }
  }
</script>
<style lang="less">
  .table-operator {
    margin-bottom: 18px;
  }
  button {
    margin-right: 8px;
  }
</style>
